package com.itheima.controller;

import com.itheima.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Value(value = "${user.name}")
    private String name;
    @Autowired
    private User user;

    @RequestMapping(value = "hello")
    public String hello(){
        System.out.println("Hello SpringBoot2! user.name:"+name);
        return "Hello SpringBoot2! user.name:"+name+", user: "+user;
    }

}
